/***************************************************************************
 *   Copyright (C) 2009 by Macedo                                          *
 *   tmacedo29@gmail.com                                                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 *                                                                         *
 * 20.04.2009  Macedo: 1st Release                                         *
 *                                                                         *
 ***************************************************************************/

#include <Deck.h>

Deck::Deck()
{
  _DeckCards.empty();
}

Deck::~Deck()
{

}

void Deck::AddCard(const Card* par_Card)
{
  _DeckCards.insert(_DeckCards.size()+1,par_Card);
}

bool Deck::RemoveCard(const Card* par_Card)
{
    par_Card = NULL;
  // _DeckCards.remove(par_Card);
  return 0;
}

int  Deck::GetNumCards(void) const
{
  return _DeckCards.size();
}

/**
  @name MoveCardToDeck
  
  @param par_card The Card to be moved
  @param par_deck The Deck to receive the card

  @brief This function should be used to move a card from this Deck to another Deck

  @return   true  -  OK
  @return   false -  Not OK
*/
bool Deck::MoveCardToDeck(const Card* par_card, Deck* par_deck)
{ 
  if (par_card==NULL)
    return false;
  if (par_deck==NULL)
    return false;
  if (RemoveCard(par_card))
  {
    par_deck->AddCard(par_card);
    return true;
  }
  else
    return false;
}

